/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jaspect.model;

import java.util.Enumeration;
import java.util.Properties;

/**
 *
 * @author Abin Baby
 */
public class AspectMethod {

    private String methodName;
    private Boolean allClassFields;
    private Properties arguments;
    private String methodBody;

    /**
     * @return the methodName
     */
    public String getMethodName() {
        return methodName;
    }

    /**
     * @param methodName the methodName to set
     */
    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    /**
     * @return the allClassFields
     */
    public Boolean getAllClassFields() {
        return allClassFields;
    }

    /**
     * @param allClassFields the allClassFields to set
     */
    public void setAllClassFields(Boolean allClassFields) {
        this.allClassFields = allClassFields;
    }

    /**
     * @return the arguments
     */
    public Properties getArguments() {
        return arguments;
    }

    /**
     * @param arguments the arguments to set
     */
    public void setArguments(Properties arguments) {
        this.arguments = arguments;
    }

    public String toString() {

        return methodName;
    }
/**
 * This is the place where ".insert(name,age)" and codes like this are generated
 * @return
 */
    public String toAspectString() {
        StringBuilder temp = new StringBuilder();

        temp.append("." + methodName + "(");
        Enumeration a = arguments.keys();
       
        for (int i = 0; i < arguments.size(); i++) {
            String se = a.nextElement().toString();
            temp.append(arguments.getProperty(se));
            temp.append(" ");
            temp.append(se);
            temp.append(",");

        }
        temp.append(")");
        return temp.toString();

    }

    /**
     * @return the methodBody
     */
    public String getMethodBody() {
        return methodBody;
    }

    /**
     * @param methodBody the methodBody to set
     */
    public void setMethodBody(String methodBody) {
        this.methodBody = methodBody;
    }
}
